<script lang='ts' setup>

function handleCloseWindow(): void {
  window.electron.ipcRenderer.send('application:close-window')
}

function handleInstallApp(): void {
  window.electron.ipcRenderer.invoke('application:install-update')
}
</script>

<template >
  <div class="downloaded-window-tips drag">
    <div class="window-options no-drag">
      <el-icon color="#999" size="20" @click="handleCloseWindow">
          <IconMdiWindowClose class="icon" />
        </el-icon>
    </div>
    <div class="content">
      新版本下载完成，是否立即安装？
    </div>
    <div class="options" >
      <el-button class="no-drag" round size="small" type="info" @click="handleCloseWindow">下次自动安装</el-button>
      <el-button class="no-drag"  round size="small" type="primary" @click="handleInstallApp">立即安装</el-button>
    </div>
  </div>
</template>

<style scoped lang='less'>
.downloaded-window-tips {
  height: 100vh;
  width: 100vw;

  .window-options {
    position: absolute;
    right: 5px;
    top: 5px;
    &:hover {
      cursor: pointer;
      .icon {
        color: #B40000;
      }
    }
  }
  .content {
    height: 70vh;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 25px;
    font-size: 14px;
  }
  .options {
    height: 30vh;
    display: flex;
    justify-content: center;
  }
}
</style>
